package com.aat.dxfy.spring.nocfgfile;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

import com.aat.dxfy.spring.nocfgfile.service.DemoService;

@Configuration
@ComponentScan(basePackages="com.aat.dxfy.spring.nocfgfile.service")
@EnableAspectJAutoProxy(proxyTargetClass=true)
public class DemoMain {
	
	@Bean
	public DemoService demoService(){
		DemoService ds=new DemoService();
		return ds;
	}

	public static void main(String[] args) {
		AnnotationConfigApplicationContext ctx=new AnnotationConfigApplicationContext();
		//
		DemoService service = ctx.getBean(DemoService.class);
		service.say("Hello");
		ctx.close();
	}

}
